import gym
import numpy as np

def get_obs_img_size():
    return 84, 84

def get_space(obs_type):
    if obs_type == 1:
        return gym.spaces.Box(-1, 1, shape=(3,), dtype=np.float32)
    else:
        return gym.spaces.Box(low=np.zeros(shape=(3, 84, 84), dtype=np.float32),
                          high=np.ones(shape=(3, 84, 84), dtype=np.float32) * 255,
                          shape=(3, 84, 84), dtype=np.float32)

def get_samle():
    return get_space().sample()

# class Observation(object):
#     def __init__(self, data=None):
#         """
#
#         :type data: (3, 84, 84)
#         """
#         if data:
#             self.data = get_space().sample()
#         else:
#             if data.shape and data.shape==(3,84,84)
#                 self.data = data
#             else:
#                 raise Exception('Observation 为 （3，84，84）形式')
#
#     def get_data(self):
#         return self.data
